package com.tvein.sanguo.action.controller.command
{
	//flash
	//pureMVC
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.utilities.fabrication.patterns.command.SimpleFabricationCommand;
	//custom
	import com.tvein.sanguo.action.common.GameConstants;
//
	public class CommandCommand extends SimpleFabricationCommand implements ICommand
	{
		override public function execute(notification:INotification) : void
		{
			switch(notification.getBody()[0])
			{
				case "-showBox":
					sendNotification(GameConstants.ACTION_SKILL, notification.getBody()[1]);
					break;
				case "-close":
					sendNotification(GameConstants.ACTION_CLOSE, notification.getBody()[1]);
					break;
				case "-getData":
					routeNotification(GameConstants.GAME_CONSOLE, ["-gameCommand", notification.getBody()[1]], null, "*");
					break;
				case "-gameCommand":
					routeNotification(GameConstants.GAME_CONSOLE, ["-gameCommand", notification.getBody()[1]], null, "*");
					sendNotification(GameConstants.ACTION_CLOSE, "*");
					break;
			}
		}
	}
}